<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link rel="stylesheet" href="/static/css/bootstrap.css">
    <style>
        /*.container{*/
            /*margin-top: 20px;*/
        /*}*/

        /*.btn{*/
            /*margin-top: 10px;*/

        /*}*/

    </style>


</head>
<body>

    <h3>查看资源</h3>
    <div class="container">
        <div class="row">
            <div class="col-md-6" style="width: 1500px;">

                <form action="/asset/" enctype="multipart/form-data" method="post">
                    <div>
                        <input type="file" name="fileName" /><input type="submit" name="上传">
                    </div>

                </form>

                <a href="/export_excel/" class="btn btn-primary">Excel导入</a>
                <a href="/addasset/" class="btn btn-primary">添加资源</a>

                <table class="table table-striped table-bordered">
                    <thead>
                        <tr>
                            <th>设备名称</th>
                            <th>IP地址</th>
                            <th>用户名</th>
                            <th>密码</th>
                            <th>设备型号</th>
                            <th>SN号</th>
                            <th>位置</th>
                            <th>资源类型</th>
                            <th>端口</th>
                            <th>系统版本</th>
                            <th>所属组</th>

                            <th>删除操作</th>
                            <th>编辑操作</th>
                        </tr>
                    </thead>

                    <tbody>
                        {% for data in db_data %}
                        <tr>
                            <td>{{ data.hostname }}</td>
                            <td>{{ data.ip_addr }}</td>
                            <td>{{ data.username }}</td>
                            <td>{{ data.password }}</td>
                            <td>{{ data.model }}</td>
                            <td>{{ data.sn }}</td>
                            <td>{{ data.local }}</td>
                            <td>{{ data.resource_type }}</td>
                            <td>{{ data.port }}</td>
                            <td>{{ data.system_version }}</td>
                            <td>{{ data.group }}</td>
                            <td><a href="/asset/{{ data.pk }}/delete" class="btn btn-danger">删除</a></td>
                            <td><a href="/asset/{{ data.pk }}/change" class="btn btn-info">编辑</a></td>

                        </tr>
                        {% endfor %}

                    </tbody>

                </table>
            </div>

        </div>


    </div>

</body>
</html>